<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>  </title>
    <style>
        .box{
            width: 200px;
            height: 200px;
            background-color: red;
            animation: py 2s linear infinite alternate ;
        }

        @keyframes py{
            from{
                transform: translateX(0);
            }
            to{
                transform: translateX(1000px);
            }
        }
    </style>
</head>
<body>
    <div class="box"></div>
</body>
</html>